The present invention relates to a shape measuring device for measuring a displacement and three-dimensional shape of an object to be measured by the use of optical means without contact with the object. More particularly, it relates to a shape measuring device in which the object to be measured is illuminated with a light beam, image information obtained by picking up its optical image is operated, and then the shape is calculated.
As one approach for measuring the displacement and three-dimensional shape of the object without contact with the object, a space coding method is known. As an example of this space coding method, the one disclosed in Japanese Patent Publication No. 5-332737 will be described with reference to FIG. 33. A shape measuring device 110 of FIG. 33 has a laser light source 117; a lens system 118 for shaping a laser light into a slit; a polygon mirror 119 for illuminating an object M to be measured with the shaped laser light; a CCD camera 111 for detecting the light reflected by the object M to be measured; and a control section 112 for controlling these elements.
The laser light source 117 is controlled so that it may be switched on/off in accordance with a predetermined rule. The polygon mirror 119 is rotated and deflects/scans the laser light. A stripe pattern is therefore formed by a portion illuminated with the laser light and a portion not illuminated with the laser light on a surface of the object M to be measured. Here, since the laser light is once scanned within a time period (pickup time period) for storing one frame (one picture) by the CCD camera 111, the stripe pattern data of the object M to be measured is stored in one frame of image data. A plurality of scans are then performed in accordance with different patterns formed by switching on/off the light source, so that a plurality of different stripe pattern data are stored whenever the scan is performed.
Subsequently, an operating unit included in the control section 112 calculates space code numbers of points on the object M to be measured in accordance with these stripe pattern data. Furthermore, the operating unit calculates coordinates of the points on the object M to be measured corresponding to pixels by the use of the principle of triangulation, so that the shape is measured.
According to this approach, the space illuminated with the light is divided into many subspaces whose cross sections are generally fan-shaped, and then a series of space code numbers are given to these subspaces. Thus, even if the object M to be measured is high (even if there is a great difference in height), the height can be operated from the space code numbers as long as the object M is placed in the space illuminated with the light. The whole shape of even the high object to be measured can be therefore measured.
A further advantage of this example, in which the laser light is scanned and used, is that a mechanical pattern mask and the replacement thereof are not needed and thus the small-sized device and the rapid measurement can be realized.
As another approach, a phase shift method (also referred to as a grating pattern projecting method or a fringe scanning method) is known. In this method, the light beam, which has the grating pattern whose distribution of illuminance is varied so that it may be shaped into a sine-wave like wave, is projected on the object to be measured. Moreover, the light beam is projected by the grating pattern in which the phase of the sine wave is shifted by 1/4 cycle into four steps. Lightness values on the height measuring points are measured for each pattern from a different angle from such a direction as to project the light beam. The phase value of the grating pattern is calculated from the lightness values. In response to the height of the measuring point, the illuminance of the light beam projected on the measuring point is changed, and thus the phase of the grating pattern is modulated. The light beam, whose phase is different from the phase observed in the absence of the object to be measured, is thus observed. Accordingly, the phase of the light beam on the measuring point is calculated and then the calculated phase is substituted into geometric expressions of an optical device by the use of the principle of triangulation, whereby the height on the measuring point (therefore, of the object) is measured, so that the three-dimensional shape is determined.
As an example of the shape measuring device according to this approach, the one disclosed in Japanese Patent Publication No. 4-278406 will be described with reference to FIG. 34. A shape measuring device 120 of FIG. 34 is used for measuring the height and shape on the points of the object M to be measured placed on a reference plane L that is a reference of measurement. This device 120 has a pickup camera 122 for picking up the object M to be measured; a projector 123 for projecting the grating pattern and for shifting the grating pattern by 1/4 cycle; a projection controller 124 for outputting a signal shifting the grating pattern by 1/4 cycle; an image memory 125 for storing four images picked up by the pickup camera 122, image by image, at the specified time; and a computer 126 for use in the measurement. Also, the computer 126 instructs the projection controller 124 to be operated, instructs the image memory 125 to store the image and reads the lightness value of the image.
The measuring method by this shape measuring device 120 is as follows. That is, the object M to be measured placed on the reference plane L is projected (illuminated) by the light having the sine-wave-shaped distribution of illuminance from the projector 123. The fringe pattern of light and shade is thereby formed on the surface of the object M to be measured. This pattern is picked up by the pickup camera 122, and then the instruction from the computer 126 allows this pattern to be stored, as a first image, in the image memory 125. Next, the instruction from the computer 126 causes the projection controller 124 to output the signal, whereby the projector 123 changes the grating pattern into another grating pattern whose phase is shifted by 1/4 cycle. Subsequently, the light is projected from the projector 123 on the object M to be measured in the same manner as described above, and the image picked up by the pickup camera 122 is stored, as a second image, in the image memory 125. In the same manner, third and fourth images, which are picked up by shifting the phase of the grating pattern by 1/4 cycle, are stored in the image memory 125. Then, the lightness values of the images are read and operated from the image data in the image memory 125, so that the height and shape on the points on the surface of the object M to be measured are calculated.
According to this approach, even if a space between gratings in the grating pattern is not reduced, the height on the points of the object to be measured can be calculated from the phase values calculated from the lightness values. For this reason, not the roughly quantized height data but the precise height data can be obtained. In other words, advantageously, a resolving power can be fine in the direction of height (the resolving power can be enhanced).
This approach is required to project the grating pattern having the sine-wave like distribution of illuminance. Means for realizing such a grating pattern is described below. That is, a mask like a bamboo blind, in which the slits of a constant width are constantly spaced, or a stripe filter (mask), in which transparent and opaque portions are alternately arranged, is previously formed. The focal point of the projected light is then shifted while this mask transmits the light, whereby the distribution of illuminance of the projected light is varied so that it may be generally shaped like the sine wave. Alternatively, the transmittance of a liquid crystal slit may be previously changed in such a manner that it is shaped like the sine wave, whereby this liquid crystal slit transmits the light so that the light is projected.
According to the above-described space coding method, it is possible to measure the whole shape of even the object to be measured having a wide range of an allowable height (dynamic range) and being high. However, the number of the given space code numbers (the number of the subspaces) cannot be more than the number of the pixels arranged in the direction in which the pickup CCD camera scans the light beam (the number of the horizontal pixels). For this reason, the increase of the resolving power in the direction of height by this approach is limited. Therefore, when the height of the object to be measured is measured by the space coding method, the roughly quantized height data is obtained.
For example, the case, in which the height of an object M1 to be measured having the shape (cross section) shown in FIG. 35(a) is measured from the reference plane L by the space coding method, will be described. In the drawing, the object M1 to be measured has the trapezoidal cross section which is rightward inclined and flat on the left upper surface thereof.
When the height (shape) of this object M1 to be measured is measured by the space coding method, the height can be wholly measured as shown in FIG. 35(b). This reason is that the range of the allowable height is wide. However, since the height is divided by the space code numbers and quantized, even the slope is calculated in the form of step-like data.
On the other hand, when the above-mentioned phase shift method is used, the typically illuminating grating pattern is adapted so as to include a plurality of waves (about several wavelengths through tens of wavelengths) like the sine wave. Accordingly, if the object to be measured is high (if there is a great difference in height), a difference between the phases, i.e. an amount of phase modulation (an amount of phase shift) exceeds 2.pi. (or 4.pi., 6.pi., . . . ), where the phases are: the phase of the light beam observed by the pixels of the CCD camera for estimating the measuring points of the object M1 to be measured; and the phase of the light beam illuminating the reference plane L when the pixels estimate the reference plane L in the absence of the object M1 to be measured. That is, compare two phases: the phase of the light beam which is inherently calculated when the light beam of the sine-wave like pattern illuminating a certain portion on the reference plane L is observed by a certain pixel; and the phase of the light beam observed by the pixel due to the placement of the object M1 to be measured. As a result of this comparison, the latter phase is modulated and thus is different from the former phase. The greater the height of the object M1 to be measured (exactly, the height of the object M1 to be measured on the measuring point estimated by the examined pixel) is, the more the amount of phase shift (the amount of phase modulation) is. In some cases, when this object M1 to be measured (exactly, the measuring point) is high, the amount of phase shift exceeds 2.pi. (or 4.pi., 6.pi., . . . ).
However, when the phase is calculated from the image information, the phase is calculated only within a range of 0 to 2.pi. due to the cyclicity of the sine wave. Therefore, 2.pi. (4.pi., 6.pi., . . . ) of the amount of phase shift exceeding 2.pi. (4.pi., 6.pi., . . . ) is ignored. That is, only the amount of phase shift of the excess over 2.pi. (4.pi., 6.pi., . . . ) contributes to the calculation of the phase. Accordingly, the height of the low object to be measured (having the amount of phase shift less than 2.pi.) can be correctly calculated. However, if the height of the high object (having the amount of phase shift of 2.pi. or more) is calculated, this calculation results in only the height equivalent to the amount of phase shift of the excess over 2.pi. (4.pi., 6.pi., . . . ) (the amount of phase shift of the remainder left by subtracting 2.pi. . . . from the inherent amount of phase shift).
For example, if the object M1 to be measured having the shape shown in FIG. 35(a) is measured by the phase shift method in the same manner as the above-mentioned space coding method, the result described below (see FIG. 35(c)) is obtained. That is, since the object M1 to be measured is low from a right end point P0 to a point P1 in the course of the slope (in a portion A), the amount of phase shift is less than 2.pi.. Therefore, shape data along the shape of the object M1 to be measured is calculated. However, since the phase seems unmodulated on the point P1 on which the amount of phase shift is just 2.pi., the calculation indicates that the height is equal to 0. Accordingly, since 2.pi. of the amount of phase shift is ignored in a portion B between the points P1 and P2 in which the amount of phase shift is more than 2.pi., the calculated height data is shaped like saw teeth once starting from 0. Furthermore, 4.pi. of the amount of phase shift is ignored in a portion C from the point P2 to a left end point P4 in which the amount of phase shift is more than 4.pi., and thus the height data is similarly calculated as the shape data obtained by subtracting the height of the amount of phase shift of 4.pi. from the actual shape.
According to the phase shift method, the height of the object to be measured can be thus measured at the high resolving power. However, it is possible to measure only the low object (having a little difference in height) in which the range of the measurable height is less than 2.pi. in terms of the amount of phase shift.
Furthermore, when the aforementioned bamboo-blind-like mask or filter having the arranged slits is used in the above-described phase shift method, the distribution of illuminance of the projected light is influenced by the amount of phase shift from the focal point. Thus, the distribution of illuminance is not always shaped like the sine wave, and consequently a phase error is made. Moreover, when the liquid crystal slit is used, the low-contrast liquid crystal slit transmits the light. For this reason, a rate of change of the distribution of illuminance of the projected light is also reduced, and thus the error of the lightness value is disadvantageously increased. Additionally, since the planar light is projected onto the object to be measured, an insufficient quantity of light of the light source would reduce the illuminance of the projected light, and, as a result, the error of the lightness value is increased. Although this may be solved by the use of the light source having a great quantity of light, this solution causes problems about a power consumption, a heat generation, a heat resistance of the slit or the like, the large-sized device, and so on.